﻿@model ConfigViewModel

@{
    ViewData["Title"] = "配置信息";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<div class="layui-card">
    <div class="layui-card-header">
        <div class="layui-form">
            <div class="layui-form-item ">
                <div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div>
            </div>
        </div>
    </div>
    <div class="layui-card-body" style="padding: 15px;">
        <form class="layui-form"  method="post" asp-action="Save"lay-filter="config-form">
            <div class="layui-form-item">
                <label class="layui-form-label">系统名称</label>
                <div class="layui-input-block">
                    <input asp-for="Title" type="text" class="layui-input" lay-verify="required|title" placeholder="请输入系统名称" value="学生信息管理系统1.0" />
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">启用验证码</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.VerifyCode" type="checkbox" lay-skin="switch" lay-text="ON|OFF">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">单账户登录</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.SingleAccount" type="checkbox" lay-skin="switch" lay-text="ON|OFF">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">开启权限验证</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.Validate" type="checkbox" lay-skin="switch" lay-text="ON|OFF">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">开启按钮权限</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.Button" type="checkbox" lay-skin="switch" lay-text="ON|OFF">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">JWT_Key</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.Jwt.Key" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">发行人</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.Jwt.Issuer" type="text" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">消费者</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.Jwt.Audience" type="text" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">有效期</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.Jwt.Expires" type="text" lay-verify="required|number" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">刷新令牌</label>
                    <div class="layui-input-inline">
                        <input asp-for="AuthConfigData.Jwt.RefreshTokenExpires" type="text" lay-verify="required|number" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>

            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;padding: 10px 0;text-align: center;background-color: #fff;">
                        <button class="layui-btn" lay-submit="" lay-filter="config-form-btn">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

@section Scripts{
    <script type="text/javascript">

        $(document).ready(function () {

        });

        // 监听表单提交事件
        hg.form.onsubmit('config-form-btn', function (data) {
            hg.msg('保存成功!');
            return true;
        });


    </script>
}